package vnreal.ZNEW.Algorithms;

import vnreal.ZNEW.GraphTest.CostHelper;
import vnreal.ZNEW.GraphTest.Link;
import vnreal.ZNEW.GraphTest.Node;
import vnreal.ZNEW.GraphTest.Path;

public class EA2 extends EnergyAlgorithm {

	private final static EA2 ea2;

	static {
		ea2 = new EA2();
	}

	private EA2() {
		super();
	}

	public static EA2 getAlgorithm() {

		return ea2;
	}

	@Override
	protected double calculateCost(Node node, Link lnk, int i, Path p) {
		double currentCost = 0;
		if (!node.isOn) {
			currentCost += Double.parseDouble(node.energy) * CostHelper.CostOfNodeOn;
		}
		return currentCost;
	}
}